<?php
 Session_Start () ;
 Include ("../../include/garennes.cfg") ;
 Include ("../../include/init.php") ;
 Include ("../../include/module_absences.cfg") ;
 Include ("../../include/module_absences.php") ;
 Include ("../include/config.inc") ;
 //Include ("../include/absences.cfg") ;
 verif_droits ($droit_courant, $_SESSION ["code"]) ;
 
 $id_eleve = var_courante ("id_eleve", 0, Null) ;
 $millesime = millesime (0) ;
 
 // Affichage des resultats
 $resultats = SQL_commande ("SELECT * FROM menus WHERE numero='".$droit_courant."' AND ordre='0'", $id_sql) ;
 $l = SQL_tableau_associatif ($resultats, "") ;
 Echo "<html><head>" ;
 entete_html ("Garennes - Module absences - R&eacute;capitulatifs", "", 1) ;
 Echo styles ("none", "none", "none", $l ["lien"], "none") ;
 Echo "</head>" ;
 Echo "<body background=\"../images/fond.png\" text=\"#000000\">" ;
 If (IsSet ($id_eleve) And ($id_eleve != 0))
  {
   If (!IsSet ($date_debut)) { $date_debut = $millesime."-09-01" ; }
   If (!IsSet ($date_fin)) { $date_fin = ($millesime+1)."-06-30" ; }
   If (!IsSet ($resul)) { $resul = 1 ; }
   If (!IsSet ($arr)) { $arr = 1 ; }
   $type = $types [1] ;
   $numero = 0 ;
   $eleve = SQL_commande ("SELECT nom,prenoms FROM eleves WHERE id_eleve='".$id_eleve."' LIMIT 1", $id_sql) ;
   $el = SQL_ligne_suivante ($eleve) ;
   $t = recapitulatif_semaine ($id_classe, $id_eleve, $date_debut, $date_fin, 1, 2, 0) ;
   // % Absences
   $absences =  affichage_recapitulatif_semaine ($t, 2, $l ["couleur_fond"], "#000000", $l["lien"], "#FFFFFF", $l["nom"], 3, 3, 2, 0) ;
   // % Retards
   $recap_semaine = affichage_recapitulatif_semaine ($t, 0, $l ["couleur_fond"], "#000000", $l["lien"], "#FFFFFF", $l["nom"], 3, 3, 2, 1) ;
   // Calendrier
   //$recap_annee = recapitulatif_annee_eleve ($id_eleve, "", "", 0, 1, 4, 2, 1, "#FFFFFF", $l ["lien"], $l ["couleur_fond"], $l ["lien"], "#000000") ;
   $table_details = details_annee_eleve ($id_eleve, $date_debut, $date_fin, 0) ;
   $table_details_annee = affichage_details_annee_eleve ($table_details, 1, 1, 2, 1, "#FFFFFF", $l ["lien"], $l ["couleur_fond"]) ;
   
   Echo "<script type=\"text/javascript\">top.travail.travail_menu.document.id_classe.id_classe.value=0;" ;
   Echo "top.travail.travail_menu.document.eleve.id_eleve.value=0;</script>" ;
   Echo "<center>R&eacute;capitulatif horaire pour <b>" ;
   Echo formatte_nom_eleve ($el [0], $el [1], 0, 1, 0)."</b></center>" ;
   Echo "<table align=\"center\" width=\"100%\">" ;
   Echo "<tr><td valign=\"top\" width=\"50%\">".$absences."</td>" ;
   Echo "<td>&nbsp;</td>" ;
   Echo "<td valign=\"top\" width=\"50%\">".$recap_semaine."</td></tr>" ;
   Echo "</table>" ;
   //Echo $recap_annee ;
   Echo "<br>" ;
   Echo $table_details_annee ;
  }
 Else
  {
   Echo "<center>Probl&egrave;me d'acc&egrave;s aux r&eacute;capitulatifs des absences et retards.</center>" ;
  }
 Echo "</body></html>" ;
?>